You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: This PR reduces Sentry noise by downgrading idle audio-device recovery timeouts from errors to warnings, fixes a real bug where multi-channel RMS level computation only read channel 0 (missing the right channel on stereo system audio), and adds a structured failure_kind tag to meeting transcription failure diagnostics. Clean, well-scoped, and correctly tested.
Blockers: None.
Should fix: None.
Nits:
ParakeetDeviceRecoveryFailurePolicy.action(wasRecording:) currently returns schedulePrewarmRetry: true unconditionally, so the if failureAction.schedulePrewarmRetry guard in ParakeetEngine.swift is a no-op today. This is fine as a forward-looking policy seam, but worth noting it doesn't change runtime behavior yet.
What looks good:
The multi-channel RMS fix is the real win here. The old data.pointee (channel 0 only) meant stereo system audio from ScreenCaptureKit (48kHz, 2ch, non-interleaved) was measuring only the left channel. The new normalizedRMSLevel correctly sums across all channels for both interleaved and non-interleaved layouts, matching how linearPeak already worked. Good catch.
Deduplication of the RMS calculation. Two identical 11-line inline computations in calculateLevel and calculateSystemLevel are replaced by one shared function with better edge-case handling (sum.isFinite, level.isFinite guards).
The policy pattern in ParakeetDeviceRecoveryFailurePolicy is consistent with the existing ParakeetStartRecordingFailurePolicy in the same file. Keeps recovery behavior decisions testable and out of the engine's timeout handler.
Test coverage is solid.testNormalizedSystemLevelUsesAllChannels creates a stereo buffer with left=0, right=0.5 and asserts level > 0.8. I verified the math: RMS ≈ 0.354, power ≈ -9.03 dB, normalized level ≈ 0.85. This would have been ~0 with the old single-channel code, so the test directly validates the fix.
failure_kind addition gives structured failure classification in Sentry/diagnostics context without leaking raw error text — MeetingFailureKind.classify maps to a fixed enum, consistent with the privacy-safe diagnostics pattern used elsewhere.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification